package kr.hkit.powerjava.chapter14.windowbuilder;

import java.awt.GridLayout;
import java.awt.HeadlessException;

import javax.swing.JButton;
import javax.swing.JFrame;

class MyFrame extends JFrame{

	public MyFrame() throws HeadlessException {
		super();
		init();
	}

	private void init() {
		setTitle("GridLayout Test");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(new GridLayout(0,3));
		add(new JButton("btn1"));
		add(new JButton("btn2"));
		add(new JButton("btn3"));
		add(new JButton("btn4"));
		add(new JButton("btn5"));
		pack();
		setVisible(true);
	}
}

public class GridLayoutEx {
	public static void main(String[] args) {
		MyFrame f= new MyFrame();
	}
}
